ActionController::Routing::Routes.draw do |map|

  map.logout '/logout', :controller => 'sessions', :action => 'destroy'
  map.login '/login', :controller => 'sessions', :action => 'new'
  map.register '/register', :controller => 'users', :action => 'create'
  map.signup '/signup', :controller => 'users', :action => 'new'

  map.root :controller => 'proposals', :action => 'index'
  
  map.resources :users, :member => { :suspend => :put,
                                        :unsuspend => :put,
                                        :purge => :delete }

  map.resource :session

  map.resources :groups

 
  map.resources :proposal_comments
  map.resources :proposals, :has_many => :proposal_comments
  map.resources :proposalcategories
  
  map.resources :blogs do |blog|
    blog.resources :blog_posts, :collection => {:drafts => :any}, :member => {:tag => :any}, :has_many => :blog_comments
  end
#  map.resources :blog_posts, :collection => {:drafts => :any}, :member => {:tag => :any}, :has_many => :blog_comments
  map.resources :blogs, :has_many => :blog_posts
  

  map.connect ':controller/:action/:id'
  map.connect ':controller/:action/:id.:format'
  
#  map.resources :blogs, 
  
  
   map.activate '/activate/:activation_code', :controller => 'users', 
                                               :action => 'activate'
    map.signup '/signup', :controller => 'users', :action => 'new'
    map.login  '/login', :controller => 'sessions', :action => 'new'
    map.logout '/logout', :controller => 'sessions', :action => 'destroy'
    map.forgot_password '/forgot_password', :controller => 'users', 
                                            :action => 'forgot_password'
    map.reset_password '/reset_password/:id', :controller => 'users', 
                                              :action => 'reset_password'        
end
